<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:th="http://www.thymeleaf.org">
<head>
<title>首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	 <div class="container"  id="content">
		 <section class="content-header">
			 <h1>
				 <i class="fa fa-file"></i>
				 <strong>合同管理</strong>
			 </h1>
			 <ol class="breadcrumb">
				 <li><a href="#"><i class="fa fa-home "></i>Home</a></li>
				 <li>合同管理</li>
				 <li class="active">合同基本信息管理</li>
			 </ol>
		 </section>
		 <!-- Main content -->
		 <section class="content">
			 <div class="box box-info">
			 	 <div class="box-header with-border">
                     <i class="fa fa-th-list"></i>
                     <h4 class="box-title">合同查询</h4>
                 </div>
                 <div class="box-body">
                    <div class="form-inline">
                    <div class="input-group">
						<!-- <input type="text" class="form-control" id="keyword"  placeholder="Search..." /> -->
						<span class="input-group-btn">
						<button th:if="${module.canRead==true}" type="button" class="btn btn-info searchBtn">查询</button>
						<button th:if="${module.canRead==true}" type="button" class="btn btn-info import">导出</button>
						<button th:if="${module.canRead==true}" type="button" class="btn btn-info importAll">导出所有合同</button>
						<button th:if="${module.canRead==true}" type="button" name="reset" id="reset-btn" class="btn btn-info resetBtn">撤消</button>
						</span>
					</div>
					<div class="btn-group pull-right">
						 	<button th:if="${module.canAdd==true}" type="button" data-toggle="dropdown" class="btn btn-info  dropdown-toggle">添加<span class="caret"></span></button>
						 	<ul class="dropdown-menu" style="margin-right:76%;">
						 	<li><a onclick="contractAdd('项目合同')" href="javascript:;">项目合同</a></li>
						 	<li><a onclick="contractAdd('备件合同')" href="javascript:;">备件合同</a></li>
						 	<li><a onclick="contractAdd('备泵合同')" href="javascript:;">备泵合同</a></li>
						 	<li><a onclick="contractAdd('维修合同')" href="javascript:;">维修合同</a></li>
						 	</ul>
						 	<!-- <button th:if="${module.canAdd==true}" type="button" class="btn btn-info  import" >导入</button> -->
							<button th:if="${module.canModify==true}" type="button" class="btn btn-info   editBtn">编辑</button>
							<button th:if="${module.canModify==true}" type="button" class="btn btn-info   editDateBtn">关键点录入</button>
						    <button th:if="${module.canModify==true}" type="button" class="btn btn-info  suspendBtn">暂停</button>
						    <button th:if="${module.canModify==true}" type="button" class="btn btn-info  terminationBtn">终止</button>
						    <button th:if="${module.canModify==true}" type="button" class="btn btn-info  revocationBtn">撤销</button>
						    <button th:if="${module.canDelete==true}" type="button" class="btn btn-info  delBtn" >删除</button>
						    <button th:if="${module.canDelete==true}" type="button" class="btn btn-info  printBtn" >打印邮寄信息</button>
						    <!-- <button th:if="${module.canAdd==true}" type="button" class="btn btn-info  app-btn-audit">发起审批</button>
						    <button th:if="${module.canAdd==true}" type="button" class="btn btn-info  app-btn-audit-cancel">撤销审批</button>
						    <button th:if="${module.canRead==true}" type="button" class="btn btn-info  btn-audit-nodes">查看审批</button> -->
						    <button th:if="${module.canRead==true}" type="button" class="btn btn-info  seeBtn">查看合同</button>
					</div>
				 </div>
                 </div>
				<div class="box box-body" >
					<table id="dataTable" class="mytable dataTable table-bordered text-center table-striped table-hover" cellspacing="0" width="5000px" align="center">
						<thead>
							
							<tr>
								<th width="1%">序号</th>
								<th width="1%"><input type="checkbox" id="checkAllContract"/></th>
								<th width="4%">合同号</th>
								<th width="3%">合同类型</th>
								<!-- <th width="3%">审批状态</th> -->
								<th width="3%">排产状态</th>
								<th width="3%">状态</th>
								<th width="3%">所属板块</th>
								<th width="3%">总价</th>
								<th width="4%">创建日期</th>
								<th width="4%">签订日期</th>
								<th width="4%">排产日期</th>
								<th width="4%">交货日期</th>
								<th width="4%">发货日期</th>
								<th width="4%">调试日期</th>
								<th width="4%">验收日期</th>
								<th width="3%">货物到站</th>
								<th width="3%">运费支付</th>
								<th width="4%">项目名称</th>
								<th width="4%">订货单位</th>
								<th width="4%">订货地址</th>
								<th width="3%">订货代表</th>
								<th width="4%">订货电话</th>
								<th width="3%">订货邮编</th>
								<th width="4%">订货片区</th>
								<th width="4%">邮寄单位</th>
								<th width="4%">邮寄地址</th>
								<th width="3%">邮寄代表</th>
								<th width="4%">邮寄电话</th>
								<th width="6%">邮寄邮编</th>
							</tr>
							
							
							<tr>
								<th width="1%"><input type="text" readonly="readonly" class="form-control"/></th>
								<th width="1%"><input type="text" readonly="readonly" class="form-control"/></th>
								<th width="4%"><input type="text" id="supplierCode-search"  class="form-control"/></th><!-- 供方合同编号 -->
								<th width="3%"><!--合同类型 -->
									<select class="form-control" type="text" id="contractType-search" name="contractType-search">
										<option></option>
										<option>项目合同</option>
										<option>备件合同</option>
										<option>备泵合同</option>
										<option>维修合同</option>
									</select>
								</th>
								<!-- <th width="3%">审批状态 
									<select class="form-control" type="text" id="auditState-search" name="auditState-search">
										<option></option>
										<option>审批中</option>
										<option>驳回</option>
										<option>通过</option>
										<option>已提交</option>
										<option>未提交</option>
									</select>
								</th> -->
								<th width="3%"><!--状态  -->
									<select class="form-control" type="text" id="cstate-search" name="cstate-search">
										<option></option>
										<option>未排产</option>
										<option>已排产</option>
									</select>
								</th>
								<th width="3%"><!--状态  -->
									<select class="form-control" type="text" id="state-search" name="state-search">
										<option></option>
										<option>正常</option>
										<option>暂停</option>
										<option>终止</option>
									</select>
								</th>
								<th width="3%"><!--所属板块  -->
									<select class="form-control" type="text" id="belongArea-search" name="belongArea-search">
							              <option></option>
										<option th:each="industryInfo:${industryInfos}"
										th:text="${industryInfo.title}"></option>
				                    </select>
								</th>
								<th width="3%"><input type="text" id="totalSum-search" class="form-control"/></th><!--总价  -->
								<th width="4%"><input type="Date" id="createTime-start-search" class="form-control"/></th><!--签订日期开始时间 -->
								<th width="4%"><input type="Date" id="signedDate-start-search" class="form-control"/></th><!--签订日期开始时间 -->
								<th width="4%"><input type="Date" id="scheduleDate-start-search" class="form-control"/></th><!--排产日期开始时间  -->
								<th width="4%"><input type="Date" id="giveOutDate-start-search" class="form-control"/></th><!--交货日期开始时间 -->
								<th width="4%"><input type="Date" id="deliveryDate-start-search" class="form-control"/></th><!--发货日期开始时间  -->
								<th width="4%"><input type="Date" id="debugDate-start-search" class="form-control"/></th><!--调试日期 开始时间-->
								<th width="4%"><input type="Date" id="acceptanceDate-start-search" class="form-control"/></th><!--验收日期开始时间  -->
								<th width="3%"><input type="text" id="stop-search" class="form-control"/></th><!--货物到站 -->
								<th width="3%"><input type="text" id="freightCharge-search" class="form-control"/></th><!--运费支付  -->
								<th width="4%"><input type="text" id="projectName-search" class="form-control"/></th><!--项目名称  -->
								<th width="4%"><input type="text" id="orderUnit-search" class="form-control"/></th><!--订货单位  -->
								<th width="4%"><input type="text" id="orderAddress-search" class="form-control"/></th><!--订货地址  -->
								<th width="3%"><input type="text" id="orderDelegate-search" class="form-control"/></th><!--订货代表  -->
								<th width="4%"><input type="text" id="orderPhone-search" class="form-control"/></th><!--订货电话  -->
								<th width="3%"><input type="text" id="orderZip-search" class="form-control"/></th><!--订货邮编  -->
								<th width="4%"><!--订货片区 -->
								<input type="text" id="orderArea-search" class="form-control"/>
									<!-- <select class="form-control" type="text" id="orderArea-search" name="orderArea-search">
										<option></option>
										<option th:each="orderArea:${orderAreas}" th:text="${orderArea}"></option>
									</select> -->
								</th>
								<th width="4%"><input type="text" id="postUnit-search" class="form-control"/></th><!--邮寄单位  -->
								<th width="4%"><input type="text" id="postAddress-search" class="form-control"/></th><!--邮寄地址  -->
								<th width="3%"><input type="text" id="postDelegate-search" class="form-control"/></th><!--邮寄代表  -->
								<th width="4%"><input type="text" id="postPhone-search" class="form-control"/></th><!--邮寄电话  -->
								<th width="6%"><input type="text" id="postZip-search" class="form-control"/></th><!--邮寄邮编  -->
							</tr>
							
							
							<!-- 结束时间 -->
							<tr>
								<th width="1%"><input type="text" readonly="readonly" class="form-control"/></th>
								<th width="1%"><input type="text" readonly="readonly" class="form-control"/></th>
								<th width="4%"><input type="text" readonly="readonly" class="form-control"/></th><!-- 供方合同编号 -->
								<th width="3%"><!--合同类型 -->
									<select class="form-control" type="text" disabled="true">
										<option></option>
										<option>项目合同</option>
										<option>备件合同</option>
										<option>备泵合同</option>
										<option>维修合同</option>
									</select>
								</th>
								<!-- <th width="3%">审批状态 
									<select class="form-control" type="text" disabled="true">
										<option></option>
										<option>审批中</option>
										<option>驳回</option>
										<option>通过</option>
										<option>未提交</option>
									</select>
								</th> -->
								<th width="3%"><!--状态  -->
									<select  class="form-control" type="text" disabled="true">
										<option></option>
										<option>未排产</option>
										<option>已排产</option>
									</select>
								</th>
								<th width="3%"><!--审批状态  -->
									<select class="form-control" type="text" disabled="true">
										<option></option>
										<option>正常</option>
										<option>暂停</option>
										<option>终止</option>
									</select>
								</th>
								<th width="3%"><!--所属板块  -->
									<select class="form-control" type="text" disabled="true">
							              <option></option>
										<!-- <option th:each="industryInfo:${industryInfos}"
										th:text="${industryInfo.title}"></option> -->
				                    </select>
								</th>
								<th width="3%"><input type="text" id="totalSum-end-search" class="form-control"/></th><!--总价  -->
								<th width="4%"><input type="Date" id="createTime-end-search" class="form-control"/></th><!--签订日期开始时间 -->
								<th width="4%"><input type="Date" id="signedDate-end-search" class="form-control"/></th><!--签订日期开始时间 -->
								<th width="4%"><input type="Date" id="scheduleDate-end-search" class="form-control"/></th><!--排产日期开始时间  -->
								<th width="4%"><input type="Date" id="giveOutDate-end-search" class="form-control"/></th><!--交货日期开始时间 -->
								<th width="4%"><input type="Date" id="deliveryDate-end-search" class="form-control"/></th><!--发货日期开始时间  -->
								<th width="4%"><input type="Date" id="debugDate-end-search" class="form-control"/></th><!--调试日期 开始时间-->
								<th width="4%"><input type="Date" id="acceptanceDate-end-search" class="form-control"/></th><!--验收日期开始时间  -->
								<th width="3%"><input type="text" readonly="readonly" class="form-control"/></th><!--货物到站 -->
								<th width="3%"><input type="text" readonly="readonly" class="form-control"/></th><!--运费支付  -->
								<th width="4%"><input type="text" readonly="readonly" class="form-control"/></th><!--项目名称  -->
								<th width="4%"><input type="text" readonly="readonly" class="form-control"/></th><!--订货单位  -->
								<th width="4%"><input type="text" readonly="readonly" class="form-control"/></th><!--订货地址  -->
								<th width="3%"><input type="text" readonly="readonly" class="form-control"/></th><!--订货代表  -->
								<th width="4%"><input type="text" readonly="readonly" class="form-control"/></th><!--订货电话  -->
								<th width="3%"><input type="text" readonly="readonly" class="form-control"/></th><!--订货邮编  -->
								<th width="4%"><!--订货片区 -->
									<input type="text" readonly="readonly" class="form-control"/>
								</th>
								<th width="4%"><input type="text" readonly="readonly" class="form-control"/></th><!--邮寄单位  -->
								<th width="4%"><input type="text" readonly="readonly" class="form-control"/></th><!--邮寄地址  -->
								<th width="3%"><input type="text" readonly="readonly" class="form-control"/></th><!--邮寄代表  -->
								<th width="4%"><input type="text" readonly="readonly" class="form-control"/></th><!--邮寄电话  -->
								<th width="6%"><input type="text" readonly="readonly" class="form-control"/></th><!--邮寄邮编  -->
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
			</div>
	  </section>
	  
	  <!--合同关键点添加/编辑弹窗-->
      <div class="modal" id="editCruxDateModal">
      	<div class="modal-dialog" role="dialog" style="width:80%">
        	<div class="modal-content" >
            	<div class="modal-header">
                	<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title"><strong>合同关键点录入</strong></h4>
                </div>
                <div style="height:580px;overflow-x:hidden;overflow-y:auto;">
                <div class="modal-body">
                <div class="form-inline">
                <form id="editCruxDateAtrrForm">
                	<input class="form-control" type="hidden" id="contractId" name="contractId"/>
                	<input type="hidden" name="cruxDateId" id="cruxDateId" />
                	<input type="hidden" name="cruxDatecreateTime" id="cruxDatecreateTime" />
                	<div class="widget-content nopadding">
                    	<table class="table table-bordered">
                        	<tbody>
                        		<tr class="odd gradeX">
									<td width="18%" align="center" style="vertical-align:middle">供方合同号</td>
									<td width="32%">
									<div class="col-md-8">
										<input class="form-control" type="text" id="supplierCode" name="supplierCode" readonly="readonly" style="width:88%"/>
							        </div>
							        <div class="col-md-4">
							            <span style="color:#F00"></span>
							        </div></td>
									<td width="18%" align="center" style="vertical-align:middle">合同类型</td>
									<td width="32%">
									<div class="col-md-8">
										<input class="form-control" type="text" id="contractType" name="contractType" readonly="readonly" style="width:88%"/>
									</div>
							        <div class="col-md-4">
							            <span style="color:#F00"></span>
							        </div></td>
								</tr>
								<tr class="odd gradeX">
									<td width="18%" align="center" style="vertical-align:middle">执行类型</td>
									<td width="32%">
									<div class="col-md-8">
										<select class="form-control" id="executiveType" name="executiveType" datatype="*,*1-100,t" nullmsg="请选择执行类型" style="width:88%">
											<option>实际发货时间</option>
											<option>调试完成时间</option>
											<option>验收完成时间</option>
										</select>
							        </div>
							        <div class="col-md-4">
							            <span style="color:#F00">*</span>
							        </div></td>
									<td width="18%" align="center" style="vertical-align:middle">执行时间</td>
									<td width="32%">
									<div class="col-md-8">
										<input class="form-control" type="date" id="executiveDate" name="executiveDate" datatype="*,*1-100,t" nullmsg="请输入执行时间" style="width:88%" />
									</div>
							        <div class="col-md-4">
							            <span style="color:#F00">*</span>
							        </div></td>
								</tr>
						        <tr class="even gradeC"> 
						            <td width="18%"  align="center" style="vertical-align:middle">备注</td>
									<td colspan="3">
						            <div class="col-md-9">
						            	<textarea class="form-control" type="text" name="memo" id="memo" style="width:100%"></textarea>
									</div>
									<div class="col-sm-3" align="center" style="vertical-align:middle">
										<button type="button" style="margin-right:40px;" class="btn btn-info pull-right saveCruxDateBtn">确定</button>
									</div>
									</td>
								</tr>
                    		</tbody>
                    	</table>
                    </div>
                <div class="form-inline">
                    <div class="form-group">
					<div class="box-header with-border">
				        <i class="fa fa-th-list"></i>
				        <h4 class="box-title">关键点列表</h4>
				    </div>
					</div>
					<div class="btn-group pull-right">
						<button type="button" class="btn btn-info editCruxDateBtn">编辑</button>
						<button type="button" class="btn btn-info delCruxDateBtn" >删除</button>
						<button type="button" style="margin-right:10px;" class="btn btn-default" data-dismiss="modal">返回</button>
					</div>
				</div>
					
						<table id="resultCruxDateTable" class="mytable dataTable table-bordered text-center table-striped table-hover"  cellspacing="0" width="100%">
							<thead>
								<tr>
									<th width="10%">序号</th>
									<th width="15%"><input type="checkbox" id="checkAllCruxDate"/></th>
									<th width="15%">执行时间</th>
									<th width="15%">执行类型</th>
									<th width="20%">创建人</th>
									<th width="25%">备注</th>
								</tr>
							</thead>
							<tbody>
							</tbody>
						</table>
				</form>
                </div>
                </div>
                </div>
            </div>
         </div>
       </div>
	  
	 	<!--查看审批弹窗 -->
	<div id="modal-audit-nodes" class="modal fade" tabindex="-1" role="dialog">
	    <div class="modal-dialog" role="document">
	        <div id="modal-audit-nodes-content"  class="modal-content">
	           
	        </div>        <!-- /.modal-content -->
	    </div>    <!-- /.modal-dialog -->
	</div><!-- /.modal -->
   <!--查看审批弹窗结束 -->        
	  <script th:src="@{/contract/contractindex.js}"></script>
	  <script type="text/javascript">
		//添加合同
	  	function contractAdd(contractType) {
	  		if(!contractType) return;
	  		window.location.href = window.rootPath + '/ui/contract/contractAdd/' + contractType;
	  	};
	  </script>
	 </div>
	
</body>
</html>